import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import apis from './script/apis.js';

// 导入element
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
Vue.use(ElementUI);

// 导入自定义组件库
import myui from './myui'
Vue.use(myui);

// 导入图标样式
import './myui/index.scss';

// 导入字体样式库
import './assets/fonts/iconfont.css'

// 导入全局样式表
import './assets/css/global.css'

// echarts
import * as echarts from 'echarts';
Vue.prototype.$echarts = echarts;


Vue.prototype.$apis=apis;


String.prototype.trim=function(){
	return this.replace(/^\s+|\s+$/g,'');
}

// 时间格式转换
Vue.filter('dateFormat', function (origin) {
  const newDate = new Date(origin);

  const n = newDate.getFullYear();
  // padStart  头部补全
  const y = (newDate.getMonth() + 1 + '').padStart('2', '0');
  const r = (newDate.getDay() + '').padStart('2', '0');
  const s = (newDate.getHours() + '').padStart('2', '0');
  const f = (newDate.getMinutes() + '').padStart('2', '0');
  const m = (newDate.getSeconds() + '').padStart('2', '0');
  return `${n}-${y}-${r} ${s}:${f}:${m}`
})

Vue.config.productionTip = false

new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
